package myClassLoader;

public class ClassLoaderTest {

	public static void main(String[] args) throws Exception {
		new ClassLoaderTest().go();
	}

	private void go() throws Exception {

		MicClassLoader ecl = new MicClassLoader();

		Class<?> cl = ecl
				.findClass("C:/Users/Mykhailo_Savytskyi/workspace/ClassLoaders/bin/myClassLoader/TestModule.class");

		Object ob = cl.newInstance();
		System.out.println(ob);

		while (true) {
			MicClassLoader ecl1 = new MicClassLoader();
			Class<?> cl1 = ecl1
					.findClass("C:/Users/Mykhailo_Savytskyi/workspace/ClassLoaders/bin/myClassLoader/TestModule.class");

			Object obj = cl1.newInstance();
			
			if (!ob.equals(obj)) {
				System.out.println(obj);
				ob = obj;
			}

		}

	}
}
